﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;

namespace LicMagnaCmsData
{
    public class MainHandler
    {
        public static string lsReturn = "";

        //麦格纳CMS数据获取
        public static string MessageHandlerGet(List<string> DataList,string type)
        {
            App.DBconSet(); //数据库连接设定
            //===========================================
            if (type == "GET")
            {
                try
                {
                    //获取数据
                    lsReturn = LicMagnaCmsData.MnCmsDataGet.GetCmsData(DataList);
                }
                catch (Exception ex)
                {
                    App.Log("麦格纳CMS数据获取", ex.ToString());
                    throw;
                }
            }
            return lsReturn;
        }

        //麦格纳CMS数据写入正天数据库
        public static string MessageHandlerSet(string xml, string tablename)
        {
            App.DBconSet(); //数据库连接设定
            //===========================================
            try
            {
                lsReturn = LicMagnaCmsData.MnCmsDataSet.SetCmsData(xml, tablename);
            }
            catch (Exception ex)
            {
                App.Log("麦格纳CMS数据获取", ex.ToString());
                throw;
            }
            return lsReturn;
        }
    }
}
